package service

import (
	"addsvc"
	"context"
	"errors"
)

var ErrZero = errors.New("not zero")
var ErrEmpty = errors.New("empty string")

func New() addsvc.Service {
	return &service{}
}

type service struct {
}

func (s *service) Sum(ctx context.Context, a, b int) (int, error) {
	if a == 0 && b == 0 {
		return 0, ErrZero
	}
	return a + b, nil
}

func (s *service) Concat(ctx context.Context, a, b string) (string, error) {
	if a == "" && b == "" {
		return "", ErrEmpty
	}
	return a + b, nil
}
